<!DOCTYPE HTML>
<html>
  <head>
	<?php echo Yaf_View_Simple::render("header.phtml"); ?>
    <script type="text/javascript" src="/asset/admin/js/fileinput.js"></script>
    <link type="text/css" rel="stylesheet" href="/asset/admin/css/fileinput.css" />    
  </head>
  <body>
	<?php echo Yaf_View_Simple::render("menu.phtml"); ?>
	<div class="create">
	  <div class="content">
		<form role="form" class="form-horizontal" id="beform" action="insert">
		  <fieldset>
			<div class="form-group">
			  <label class="col-lg-2 control-label" for="link">Link:</label>
			  <div class="col-lg-6">
				<input type="text" name="link" class="form-control" id="link" value=""/>
			  </div>
			</div>            
			<div class="form-group">
			  <label class="col-lg-2 control-label" for="title">Title:</label>
			  <div class="col-lg-6">
				<input type="text" name="title" class="form-control" id="title" />
			  </div>
			</div>

			<div class="form-group">
			  <label class="col-lg-2 control-label" for="style">Style:</label>
			  <div class="col-lg-4">
				<input type="text" name="style" class="form-control" id="style" />
			  </div>
			</div>
			<div class="form-group">
			  <label class="col-lg-2 control-label" for="description">Description:</label>
			  <div class="col-lg-6">
				<textarea name="description" class="form-control" id="description" rows="5"></textarea>
			  </div>
			</div>
			<div class="form-group">
			  <label class="col-lg-2 control-label" for="sort">Sort:</label>
			  <div class="col-lg-2">
				<input type="text" name="sort" class="form-control" id="sort" />
			  </div>
			</div>
			<div class="form-group">
			  <label class="col-lg-2 control-label" for="sign">Sign:</label>
			  <div class="col-lg-2">
				<input type="text" name="sign" class="form-control" id="sign" />
			  </div>
			</div>             
			<div class="form-group">
			  <label class="col-lg-2 control-label" for="picture">Picture:</label>
			  <div class="col-lg-6">
				<input type="hidden" name="picture" class="form-control" id="picture" value=""/>
                <input id="input-id" type="file" class="file" data-preview-file-type="text" >
			  </div>
			</div>            						
			<div class="form-group">
		      <label class="col-lg-2 control-label"></label>
		      <div class="col-lg-6">
		        <a  href="javascript:def.submit('#beform',null)" class="btn btn-primary">Submit</a>
		      </div>
            </div>
		  </fieldset>
		</form>

	  </div>
	</div>
	
	<!-- 模态框（Modal） -->
	<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="modellabel" aria-hidden="true">
	  <div class="modal-dialog">
		<div class="modal-content">
		  <div class="modal-header bg-default">
			<div class="modal-title" id="modallabel">
			  <h5 class="text-primary">Signal</h5>
			</div>
		  </div>
		  <div class="modal-body bg-primary">
			
		  </div>
		  <div class="modal-footer">
			<button type="button" class="btn btn-default" data-dismiss="modal">Close
			</button>
		  </div>
		</div><!-- /.modal-content -->
	  </div><!-- /.modal -->
	</div>		

	<?php echo Yaf_View_Simple::render("footer.phtml"); ?>
    <script type="text/javascript">
     $("#input-id").fileinput({
         uploadUrl: '/admin/slide/uploade',
         showUpload: true,
         showCaption: false,
         browseClass: "btn btn-primary",
         previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
         allowedPreviewTypes: ['image'],
         allowedFileTypes: ['image'],
         allowedFileExtensions:  ['jpg', 'png','gif'],             
     }).on('fileuploaded', function(event, data) {
         var file = data.response.file_data;
         image = '/'+file.root_path+'/'+file.save_path+file.save_name;
         $("#picture").val(image);
     });
    </script>      
  </body>
</html>
